package com.data.mapper;

import com.data.entity.User;
import com.data.entity.faceDto.FaceUserInfo;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Select({
            "<script>"+
                    "select * FROM t_user  order by createtime desc limit #{page},#{limit}",
            "</script>"
    })
    List<User> listPage(@Param("page")Integer page,
                        @Param("limit")Integer limit);

    @Select({
            "<script>"+
                    "select count(1) FROM t_user  ",
            "</script>"
    })
    int count();

    @Select({
            "<script>"+
                    "select face_id,name,face_feature from t_user",
            "</script>"
    })
    List<FaceUserInfo> getUserFaceInfoByGroupId();
}
